-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check existence of the order in the orderbook, and add polledOrderInOrderbook #166
Conversation
CLA Assistant Lite bot: I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request |
The unit tests are broken :/ |
@alfetopito worked for me. |
Test are ✅ GREEN! |
@alfetopito merging, let me know if you have any other comments |
This PR adds a 2 things:
A new check, after we get the order that "should" be created, we double-check if it was already created or not by quering the orderbook.
After we verify the existence of the order, the polling will return by default
TRY_NEXT_BLOCK
, but at the same time it will give the concrete order to give a different result. This will allow orders like Twap to say: "Ok, so if current part is already created, next part should be starting by this exact time, therefore it will return aTRY_AT_EPOCH
overridingTRY_NEXT_BLOCK
default).This will allow orders to be polled much more efficiently, for example, DCA that trades once a month, you will not need to check every block between two months.
Also, another efficiency, is that watch towers will not need to post the orders if someone else already posted it, reducing drastically the errors of
DuplicatedOrder
.Not included
Next PRs I plan to add: